pass previousTag to conventionalChangelog in gitRawCommitsOpts to select commit messages #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using the default
release-it
changelog generator, I can specify a tag using the--git.tagMatch
and--github.tagMatch
arguments, and the generated changelog then includes commit messages since the specified tag.However, when using the
@release-it/conventional-changelog
plugin, these arguments only control which tag is linked in the changelog headers; they do not control which commit messages appear in the changelog. Only the messages from the most recent semver tag toHEAD
are included.This is the expected behavior from
conventional-changelog
when it is called the way it is from@release-it/conventional-changelog
, withpreviousTag
in thecontext
. Theconventional-changelog-core
documentation links to theconventional-changelog-writer
docs, which say that thecontext
parameter contains "Variables that will be interpolated to the template." This means that thecontext
parameter only defines what shows up in the templated lines of the changelog; it does not affect which commit messages are selected for inclusion. The parameter which controls which commit messages are selected isgitRawCommitsOpts
.To make
@release-it/conventional-changelog
behave the same way as the defaultrelease-it
changelog generator, it would be necessary to passfrom
ingitRawCommitsOpts
. Here is a patch that does so.Alternatively, a workaround is to select the previous tag before running
release-it
, then invokerelease-it
with the necessary parameters:It seems to me that
@release-it/conventional-changelog
ought to behave the same way as the defaultrelease-it
changelog generator, and usepreviousTag
when selecting the commit messages.If instead it is intentional that it behave like
conventional-changelog
and only use thepreviousTag
in the changelog headers and not when selecting the commit messages, then I think that this ought to be noted clearly in the documentation (with the above workaround if possible).